package com.zr.utils.result;

import lombok.Data;

/**
 * @ClassName ResultBuilderUtil
 * @Description 表单校验工具类
 * @Author 马家奎
 * @Date 2019/11/7 19:42
 */
@Data
public class ResultBuilderUtil<T> {



    public static<T> ResultUtil success(T data){

        ResultUtil resultUtil = new ResultUtil<>();

        resultUtil.setSuccess(true);
        resultUtil.setErrorMessage("succeed");
        resultUtil.setData(data);

        return resultUtil;
    }
    public static<T> ResultUtil error(String errorMessage){

        ResultUtil resultUtil = new ResultUtil<>();

        resultUtil.setSuccess(false);
        resultUtil.setErrorMessage(errorMessage);
        return resultUtil;
    }

}
